package colibri.keyboard;

/**
 *
 * @author Bayron Thiengo Quinelato
 */
public class SureType {

    public static char[] getCharacter(int keyCode) {
        switch (keyCode) {
            case 113:
                return new char[]{'q', 'w'};
            case 49:
                return new char[]{'e', 'r'};
            case 50:
                return new char[]{'t', 'y'};
            case 51:
                return new char[]{'u', 'i'};
            case 111:
                return new char[]{'o', 'p'};
            case 97:
                return new char[]{'a', 's'};
            case 52:
                return new char[]{'d', 'f'};
            case 53:
                return new char[]{'g', 'h'};
            case 54:
                return new char[]{'j', 'k'};
            case 108:
                return new char[]{'l'};
            case 122:
                return new char[]{'z', 'x'};
            case 55:
                return new char[]{'c', 'v'};
            case 56:
                return new char[]{'b', 'n'};
            case 57:
                return new char[]{'m'};
            case 48:
                return new char[]{' '};
            case 10:
                char ch = (char)keyCode;
                return new char[]{ch};

            //Teclas em ALT
            case 33:
                return new char[]{'!'};
            case 69:
                return new char[]{'1'};
            case 84:
                return new char[]{'2'};
            case 85:
                return new char[]{'3'};
            case 46:
                return new char[]{'.'};
            case 63:
                return new char[]{'?'};
            case 68:
                return new char[]{'4'};
            case 71:
                return new char[]{'5'};
            case 74:
                return new char[]{'6'};
            case 44:
                return new char[]{','};
            case 64:
                return new char[]{'@'};
            case 67:
                return new char[]{'7'};
            case 66:
                return new char[]{'8'};
            case 77:
                return new char[]{'9'};
            case 128:
                return new char[]{'*', '-', '_', '@', '/', '\\', '&', ';', ':', '\'', '"', '$', '(', ')',
                '|', '[', ']', '<', '>', '%', '+', '=' };
            case 32:
                return new char[]{'0'};
            case 137:
                return new char[]{'#'};
            default:
                return null;
        }
    }

    public static char getNumericInteger(int keyCode) {
        if( keyCode >= 48 && keyCode <= 57 ){
            return (char)keyCode;
        }
        switch (keyCode) {
            case 69:
                return '1';
            case 84:
                return '2';
            case 85:
                return '3';
            case 68:
                return '4';
            case 71:
                return '5';
            case 74:
                return '6';
            case 67:
                return '7';
            case 66:
                return '8';
            case 77:
                return '9';
            case 32:
                return '0';
            default:
                return 'X';
        }
    }

    public static char getNumericFloat(int keyCode) {
        switch(keyCode){
            case 44:
            case 108:
            case 46:
            case 111:
                return '.';
            case 33:
            case 113:
                return '-';
            default:
                return getNumericInteger(keyCode);
        }
    }

}
